<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>关于数据传递问题</title>
</head>
<body>
<!-- 
问题：在js调用函数传递变量参数时，是值传递还是引用传递
    * 理解1：都是值（基本值、地址值）传递
    * 理解2：可能是值传递、也可能是引用传递(地址值)

-->
<script>
   var a = 3;
   function fn(a) {
       a = a + 1;
   }
   fn(a);
   console.log(a); // 3

   function fn2(obj) {
        console.log(obj.name)
   }

   var obj = {name: 'Tom'};
   fn2(obj);
</script>
</body>
</html>